$(document).ready(function() {
	/*
	// Store the title attribute from button spans, 
    // which are then used to process commands. The title
    // attriute is removed to prevent the title pop-up.
    // Additionally handles button hover effects.
    //
    // CI_view[0] will contain the target element id
    // CI_view[1] will contain the view to load
	*/
	$(".button").live("mouseover", function() {
        $(this).addClass("ui-state-hover");
        $.CI_view = $(this).attr("title").split(",");
		$(this).attr("title","");
	});
	$(".button").live("mouseout", function() {
        $(this).removeClass("ui-state-hover");
		$(this).attr("title",$.CI_view);
	});
    
	/*
	// AJAX load a view when a button is clicked 
	*/
    $(".button").live("click", function () {
        $($.CI_view[0]).load($.CI_view[1]);
    });
});